# -*- coding: utf-8 -*-
# @Time    : 2019/2/18 14:46
# @Author  : zjj
# @Email   : 1933860854@qq.com
# @File    : adminx.py
# @Software: PyCharm
from .models import AdSchool, AdSchoolLabel, AdSchoolZan
import xadmin
class AdSchoolAdmin(object):
    list_display = ['id', 'ad_school_title', 'ad_school_label', ]
    search_fields = ['ad_school_title', ]
    list_filter = ['ad_school_title', ]
    model_icon = 'fa fa-pie-chart'
    style_fields = {"ad_school_article": "ueditor"}
    exclude = ['ad_school_create_time', 'ad_school_update_time', 'ad_school_browse_time', ]
xadmin.site.register(AdSchool, AdSchoolAdmin)

class AdSchoolLabelAdmin(object):
    list_display = ['id', 'ad_school_label', 'create_time', ]
    search_fields = ['ad_school_label', ]
    list_filter = ['ad_school_label', ]
    exclude = ['create_time', 'update_time', ]
    model_icon = 'fa fa-pie-chart'
xadmin.site.register(AdSchoolLabel, AdSchoolLabelAdmin)

class AdSchoolZanAdmin(object):
    list_display = ['id', 'article', 'user', 'create_time', ]
    search_fields = ['article', ]
    list_filter = ['article', ]
    model_icon = 'fa fa-pie-chart'
xadmin.site.register(AdSchoolZan, AdSchoolZanAdmin)